import request from '@/utils/request'
// 设备管理渲染数据
export const list = (params) => request({
  url: '/vm-service/vm/search',
  method: 'GET',
  params
})

// 搜索售货机(售货机列表)
export const machineList = () => request({
  url: '/vm-service/vm/search',
  method: 'GET'
})

// 策略列表
export const strategyList = (id) => request({
  url: '/vm-service/policy/vmPolicy/' + id,
  method: 'GET'
})

// 设备管理修改部分的点位搜索结果（为修改做准备）
export const equipmentNode = (params) => request({
  url: '/vm-service/node/search',
  method: 'GET',
  params
})

// 提交设备管理的修改
export const editEquipmentNode = (data) => request({
  url: `/vm-service/vm/${data.id}/${data.nodeId}`,
  method: 'PUT'
})

// 提交新增售货机
export const addEquipment = (data) => request({
  url: '/vm-service/vm',
  method: 'POST',
  data
})

// 批量策略管理列表
export const largeStrategyList = () => request({
  url: '/vm-service/policy',
  method: 'GET'
})

// 修改策略管理
export const editLargeStrategy = (data) => request({
  url: '/vm-service/policy/' + data.policyId,
  method: 'PUT',
  data
})

// 货道弹窗信息
export const aisleList = (id) => request({
  url: '/vm-service/channel/channelList/' + id,
  method: 'GET'
})
// 内层货道弹窗打开渲染的列表
export const aisleChooseList = (params) => request({
  url: '/vm-service/sku/search',
  method: 'GET',
  params
})

// 获取货道详情
export const getGoodsDetail = (id) => request({
  url: '/vm-service/vmType/' + id,
  method: 'GET'
})
// 获取售货机货道详情
export const getChannelDetail = (code) => request({
  url: 'vm-service/channel/channelList/' + code,
  method: 'GET'
})
// 获取商圈下销量前10的商品
export const getTopGoods = (id) => request({
  url: 'vm-service/sku/businessTop10/' + id,
  method: 'GET'
})
// 获取商圈列表
export const getGoodsCircleList = (id) => request({
  url: 'vm-service/businessType/name/' + id,
  method: 'GET'
})

// 获取商圈列表
export const getSkuList = (params) => request({
  url: 'vm-service/sku/search',
  method: 'GET',
  params
})
